#ifndef _PWN_H_
#define _PWM_H_

typedef struct {
  INT16U   DDA_Tms;      // DDA period, 
  INT16U   Count;        // Output pulse count
}HSPO;

typedef struct {
  uint32_t   Frequency;      // DDA period, 
  uint32_t   xpulseCount;        // Output pulse count
  uint32_t   ypulseCount;        // Output pulse count  
}HSPO_CMD;

typedef struct {
  uint16_t   DDA_Cycle;      // DDA period, unit ms
  uint16_t   xpulseCount;    // Output pulse count
  uint16_t   ypulseCount;    // Output pulse count  
}DDA_CMD;

typedef struct {
  uint32_t   TotalGateCount;      // DDA period, 
  uint32_t   xduration_count;     // Output pulse count
  uint32_t   yduration_count;     // Output pulse count
  uint16_t   Prescaler;  
}TIMER_CMD;

typedef struct {
  uint16_t   DDA_Time;    // DDA time, unit in ms
  uint16_t   DDA_Count;   // Reload count
  uint16_t   Prescaler;   // Prescaler time
} DDA_DIV_TABLE;



void hspo_init(void);
void hspo(int Channel, int Output);
void SetPulseOut(uint32_t Frequency, uint32_t pulseCount);
void SetPulseOuts(HSPO_CMD *PlsoCmd);
void hspoTask( void *pvParameters );
#endif
